Help:Interwiki linking
From PyroGuide
Contents |
[edit] General
By adding a prefix to another project, internal link style ("prefixed internal link style") can be used to link to a page of another project. For example, [[wikipedia:interWiki]]
links to the wikipedia:interWiki article on the English Wikipedia. This is called interwiki. For each project, an interwiki map (a list of target projects with their prefixes) is specified (example). These target projects need not use MediaWiki and need not even be a wiki.
A project's own namespace prefix cannot be reused as code for an external project. However, the prefix used for a target project may coincide with the prefix for a project namespace within that project. As a result, to link to a page in that namespace, use the same prefix twice, e.g. en:Wikisource:Wikisource:Scriptorium.
For portability across projects, one may want to select a link code that leads to the same target from all projects, e.g. MetaWikipedia:wikibooks:Main Page. The "superfluous" "MetaWikipedia:" prevents "wikibooks:" to be interpreted as namespace prefix when the code is used at wikibooks itself, while at Meta the "MetaWikipedia:" is ignored (it is not a namespace prefix, and even at Meta itself it is recognized as code for Meta). The codes above work from all projects. However, the existence detection and the self-link feature do not work on interwiki links.
[edit] Interwiki linking from and within Wikimedia
Within Wikimedia, for the purpose of interlanguage links (see above) the project families are Wikipedia, Wiktionary, Wikiquote, Wikibooks and Wikisource. Thus this applies for a link like en:, de:, etc., from a Wikipedia to another one, from a Wiktionary to another one, from a Wikiquote to another one, from a Wikibooks to another one or from a Wikisource to another one.
The interlanguage link feature works on Commons, and produces links to the Wikipedias. This is not reciprocal: a link from a Wikipedia to Commons is an in-page link.
[edit] Project titles and shortcuts
Project | Example | Shortcut |
---|---|---|
[[commons:]]
| commons: | |
[[mediazilla:]]
| mediazilla: | |
[[wikibooks:]]
| wikibooks: | [[b:]] b:
|
[[meta:]]
| meta: | [[m:]] m:
|
[[wikinews:]]
| wikinews: | [[n:]] n:
|
[[wikiquote:]]
| wikiquote: | [[q:]] q:
|
[[wikisource:]]
| wikisource: | [[s:]] s:
|
[[wikipedia:]]
| Wikipedia: | [[w:]] w:
|
[[wiktionary:]]
| wiktionary: | [[wikt:]] wikt:
|
The long form doesn't work within the same project. The shortcut works everywhere.
[edit] Prefixes
The following rules apply:
- links like this are possible ("Main Page" and "de:" are just examples):
- en:Main Page, de:Hauptseite, etc. - language version of the same set of projects; this works for all existing Wikipedias (list of codes), Wiktionaries, and Wikiquotes (same list, but a Wikiquote doesn't exist for all languages yet); from other projects it links to the Wikipedia in the specified language; although http://os.wikipedia.org exists, "os:" does not work: os:a
- w:Main Page (see also bugzilla:971):
- from Wikipedias, this links to the English Wikipedia
- from non-Wikipedias, this links to the Wikipedia in the same language
- w:en:Main Page - English Wikipedia (note that w:w:Main Page links to the English Wikipedia from non-English non-Wikipedias, but gives "Bad title" from other projects)
- w:de:Hauptseite - German Wikipedia (also from a Wiktionary or Wikiquote) (sometimes this does not work, perhaps this depends on the use of special characters)
- m:Main Page - Meta
- s: - Wikisource in the same language as the project the link is from (if that is multilingual, then start page with ring and list of languages)
- w:de:s:Hauptseite - example, German Wikisource link in the English Wikipedia
- [[w:de:s:]] w:de:s: doesn't work yet on m: and en:, add a page name like Hauptseite
- commons:Main Page - Wikimedia Commons
- wikt:Main Page - Wiktionary in the same language as the project the link is from (if that is multilingual, then English)
- bugzilla: - Mediazilla, the bug tracker; use this to link to bug reports like bugzilla:123
- q:Main Page - Wikiquote in the same language as the project the link is from (if that is multilingual, then English), except from a wikiquote
- b:Main Page - Wikibooks in the same language as the project the link is from (if that is multilingual, then English), except from a wikibooks
- n:Main Page - Wikinews in the same language as the project the link is from (if that is multilingual, then English), except from a wikinews
- sep11:In Memoriam - In Memoriam wiki
Some cases also work without the "m:" if the link is not from the project itself, see below.
- a prefix that is "superfluous", because it refers to the same project, is allowed in the case of the prefix en:, de:, etc., w:, and m:, but not for the prefixes wiktionary:, wikibooks:, wikiquote and commons (in the project itself the last four are taken as namespace prefixes)
- as demonstrated above by the double prefixes, links may cumulate, thus enabling links that are not possible with a single prefix:
- links from a Wiktionary or Wikiquote to a Wikipedia other than the English one go through the English Wikipedia
- Examples: from French Wikiquote to:
- English Wikipedia: [[:en:wikipedia:<whatever>|<whatever>]]
- English Wikiquote: [[:en:<whatever>|<whatever>]]
- French Wikipedia: [[:w:<whatever>|<whatever>]]
- Examples: from French Wikiquote to:
- links from a Wikipedia to a Wiktionary or Wikiquote other than the English one go through the English Wiktionary
- Examples: from French Wikipedia to:
- English Wikipedia [[:en:<whatever>|<whatever>]]
- English Wikiquote [[:wikiquote:<whatever>|<whatever>]]
- French Wikipedia [[:wikiquote:fr:<whatever>|<whatever>]]
- Examples: from French Wikipedia to:
- links from a Wikipedia to Wikisource go through Meta
- links from a Wiktionary or Wikiquote to a Wikipedia other than the English one go through the English Wikipedia
- remember that q: and b: work differently from w:; e.g., b: from wikibooks itself does not work. See also MediaZilla:971.
- for portability across projects one may want to select a link code that leads to the same target from each project, e.g. m:wikibooks:Main Page. The "superfluous" m: prevents "wikibooks:" to be interpreted as namespace prefix when the code is used at wikibooks itself, while at Meta the m: is ignored (it is not a namespace prefix, and even at Meta itself it is recognized as code for Meta); the codes above work from all projects; however, when used on the project itself, the existence detection and the self-link feature do not work.
Prefixed internal link style is also possible for links to various wikis and some other sites outside Wikimedia, e.g. Wiki:WelcomeVisitors and MeatBall:MeatballWiki, and Google:searchterm. A list of sites is at [1], see also Interwiki map and en:Interwiki.
A prefix other than w:, wiktionary:, wikiquote:, m:, wikibooks, a valid language code, or a valid code for an external wiki, is treated as an internal link: a namespace prefix or just the first part of the name of a page in the main namespace.
The simplest interwiki links consist of the prefix only; they lead to the main page.
Only links within a project may show as broken, leading to the edit page. Existence is not shown for links to pages of other projects, until the link is applied.
[edit] Interlanguage link
For a multilingual family of similar projects, with one project per language, a system for interlanguage linking can be set up. If this project is in a family for which this applies, Help:Interlanguage link demo may demonstrate what is explained below (this depends on whether the same language codes are used).
An interwiki link within the family is treated differently (unless it is on a talk page of any namespace): it appears at one or two edges of the webpage (left in Monobook, and top and bottom in Classic). The link label depends only on the sister project that is linked to, not on the linked page. The label is set in the configuration of the project. Typically, it is the name of the language written in that language. The target is only shown in the status bar, depending on the browser (oddly, there is not even a hover box).
Thus, interlanguage link is mainly suitable for linking to the corresponding page in another language. It is not suitable for multiple links of the same other language. See Interlanguage use case for a discussion of common troubles with this system and other possible implementations.
The feature can also be used on an image description page to link to the same or a similar image in a sister project. Other interwiki links to images require the prefixed colon.
Note that, if a page may be used as a template (even if it is not in the template namespace), it should not have an interlanguage link; such a link appears in the edge of the page that includes the template, giving the impression that the link is to a version of the referring page in the other language. For the same reason, pages in the MediaWiki namespace are not suitable to put an interlanguage link in.
The mutual order of interlanguage links is preserved, but otherwise the positions within the wikitext are immaterial. Usually they are put at the end. With section editing they appear in the preview if they are in the section being edited.
A link to the project itself (hence also a link to the page itself), even if referred to with the project prefix, appears in-page.
Suppose that we have pages de:Zug, en:Train, fr:Train then we need:
Thus there is not the possibility of simply copying each list, let alone of using a template, as can be done if different languages share one project, with or without separate namespaces, see e.g.:
- Template:H-langs:Interwiki linking used at the bottom of the master copy of this page on Meta
- wikisource:Template:InterLingvLigoj
- Template:About.
Examples of project families with interlanguage links:
- several Wikimedia project families, see below
- a family of six Wikia projects, see wikicities:c:WikiMac:WikiMac:Interlanguage links
[edit] In-page interlanguage links
To make an interlanguage link in-page, prefix a colon (e.g. [[:en:wiki|wiki]]). This can e.g. be useful to link to a page in another language if no local version is available. See also some example templates for conveniently making such links: Template:Tiw, Template:Tiw, Template:Tiw, and Template:Tiw.
[edit] Interlanguage link in the wider sense
An interlanguage link in the wider sense includes what, for the software, is a regular link, also an internal one on projects which are shared by different languages: Meta and Wikisource, see:
Possible reasons for using an "interlanguage link" in the page body include:
- control over position
- control over label
- especially useful in the case of a page used as a template, so that on the referring page the link label can explain what the link target is.
- the target contains an anchor